
from function import Function
class SoilExposeModel():
    def __init__(self):
        self.A1=Function("(((OSIR_c * ED_c * EF_c) / (BW_c) + (OSIR_a * ED_a * EF_a) / (BW_a)) * ABS_o) / (AT_ca) * pow(10,-6)")
        self.A2=Function("(OSIR_c * ED_c * EF_c * ABS_o) / (BW_c * AT_nc) * pow(10,-6)")
        self.A3=Function("(SAE_c * SSAR_c * EF_c * ED_c * E_v * ABS_d) / (BW_c * AT_ca) * pow(10,-6) + (SAE_a * SSAR_a * EF_a * ED_a * E_v * ABS_d) / (BW_a * AT_ca) * pow(10,-6)")
        self.A4=Function("239 * pow(H_c,0.417)* pow(BW_c,0.517) * SER_c" )
        self.A5=Function("239 * pow(H_a,0.417) * pow(BW_a,0.517) * SER_a" )
        self.A6=Function("(SAE_c * SSAR_c * EF_c * ED_c * E_v * ABS_d) / (BW_c * AT_nc) * pow(10,-6)")
        self.A7=Function("(PM_10 * DAIR_c * ED_c * PIAF * (fspo * EFO_c + fspi * EFI_c)) / (BW_c * AT_ca) * pow(10,-6) + (PM_10 * DAIR_a * ED_a * PIAF * (fspo * EFO_a + fspi * EFI_a)) / (BW_a * AT_ca) * pow(10,-6)")
        self.A8=Function("(PM_10 * DAIR_c * ED_c * PIAF * (fspo * EFO_c + fspi * EFI_c)) / (BW_c * AT_nc) * pow(10,-6)")
        self.A9=Function("VFsuroa * ((DAIR_c * EFO_c * ED_c) / (BW_c * AT_ca) + (DAIR_a * EFO_a * ED_a) / (BW_a * AT_ca))")
        self.A10=Function("VFsuroa * (DAIR_c * EFO_c * ED_c) / (BW_c * AT_nc)")
        self.A11=Function("VFsuboa * ((DAIR_c * EFO_c * ED_c) / (BW_c * AT_ca) + (DAIR_a * EFO_a * ED_a) / (BW_a * AT_ca))")
        self.A12=Function("VFsuboa * (DAIR_c * EFO_c * ED_c) / (BW_c * AT_nc)")
        self.A13=Function("VF_gwoa * ((DAIR_c * EFO_c * ED_c) / (BW_c * AT_ca) + (DAIR_a * EFO_a * ED_a) / (BW_a * AT_ca))")
        self.A14=Function("VFgwoa * (DAIR_c * EFO_c * ED_c) / (BW_c * AT_nc)")
        self.A15=Function("VF_subia * ((DAIR_c * EFO_c * ED_c) / (BW_c * AT_ca) + (DAIR_a * EFO_a * ED_a) / (BW_a * AT_ca))")
        self.A16=Function("VF_subia * (DAIR_c * EFI_c * ED_c) / (BW_c * AT_nc)")
        self.A17=Function("VF_gwia * ((DAIR_c * EFI_c * ED_c) / (BW_c * AT_ca) + (DAIR_a * EFI_a * ED_a) / (BW_a * AT_ca))")
        self.A18=Function("VF_gwia * (DAIR_c * EFI_c * ED_c) / (BW_c * AT_nc)")
        self.A19=Function("(GWCR_c * EF_c * ED_c) / (BW_c * AT_ca) + (GWCR_a * EF_a * ED_a) / (BW_a * AT_ca)")
        self.A20=Function("(GWCR_c * EF_c * ED_c) / (BW_c * AT_nc)")
        self.A21=Function("(OISER_a * ED_a * EF_a * ABS_o) / (BW_a * AT_ca) * pow(10,-6)")
        self.A22=Function("(OISER_a * ED_a * EF_a * ABS_o) / (BW_a * AT_nc) * pow(10,-6)")
        self.A23=Function("(SAE_a * SSAR_a * EF_a * ED_a * E_v * ABS_d) / (BW_a * AT_ca) * pow(10,-6)")
        self.A24=Function("(SAE_a * SSAR_a * EF_a * ED_a * E_v * ABS_d) / (BW_a * AT_nc) * pow(10,-6)")
        self.A25=Function("(PM_10 * DAIR_a * ED_a * PIAF * (fspo * EFO_a + fspi * EFI_a ))/ (BW_a * AT_ca) * pow(10,-6)")
        self.A26=Function("(PM_10 * DAIR_a * ED_a * PIAF * (fspo * EFO_a + fspi * EFI_a)) / (BW_a * AT_nc) * pow(10,-6)")
        self.A27=Function("VF_suroa * (DAIR_a * EFO_a * ED_a) / (BW_a * AT_ca)")
        self.A28=Function("VF_suroa * (DAIR_a * EFO_a * ED_a) / (BW_a * AT_nc)")
        self.A29=Function("VF_suboa * (DAIR_a * EFO_a * ED_a) / (BW_a * AT_ca)")
        self.A30=Function("VF_suboa * (DAIR_a * EFO_a * ED_a) / (BW_a * AT_nc)")
        self.A31=Function("VF_gwoa * (DAIR_a * EFO_a * ED_a) / (BW_a * AT_ca)")
        self.A32=Function("VF_gwoa * (DAIR_a * EFO_a * ED_a) / (BW_a * AT_nc)")
        self.A33=Function("VF_subia * (DAIR_a * EFI_a * ED_a) / (BW_a * AT_ca)")
        self.A34=Function("VF_subia * (DAIR_a * EFI_a * ED_a) / (BW_a * AT_nc)")
        self.A35=Function("VF_gwia * (DAIR_a * EFI_a * ED_a) / (BW_a * AT_ca)")
        self.A36=Function("VF_gwia * (DAIR_a * EFI_a * ED_a) / (BW_a * AT_nc)")
        self.A37=Function("(GWCR_a * EF_a * ED_a) / (BW_a * AT_caa)")
        self.A38=Function("(GWCR_a * EF_a * ED_a) / (BW_a * AT_nc)")
class SoilExposeModelType1(SoilExposeModel):
    def 经口摄入土壤途径(self,params):
        ca=self.A1(params) #致癌
        nc=self.A2(params) #非致癌
        return {"ca":ca,"nc":nc}
    def 皮肤接触土壤途径(self,params):
        SAE_c=self.A4(params)
        SAE_a=self.A5(params)
        extras={"SAE_c":SAE_c,"SAE_a":SAE_a}
        ca=self.A3(params,extras)
        nc=self.A6(params,extras)
        return {"ca":ca,"nc":nc}
    def 吸入土壤颗粒物途径(self,params):
        ca=self.A7(params)
        nc=self.A8(params)
        return {"ca":ca,"nc":nc}
    def 吸入室外空气中来自表层土壤的气态污染物途径(self,params):
        ca=self.A9(params)
        nc=self.A10(params)
        return {"ca":ca,"nc":nc} 
    def 吸入室外空气中来自下层土壤的气态污染物途径(self,params):
        ca=self.A11(params)
        nc=self.A12(params)
        return {"ca":ca,"nc":nc} 
    def 吸入室外空气中来自地下水的气态污染物途径(self,params):
        ca=self.A13(params)
        nc=self.A14(params)
        return {"ca":ca,"nc":nc}  
    def 吸入室内空气中来自下层土壤的气态污染物途径(self,params):
        ca=self.A15(params)
        nc=self.A16(params)
        return {"ca":ca,"nc":nc} 
    def 吸入室内空气中来自地下水的气态污染物途径(self,params):
        ca=self.A17(params)
        nc=self.A18(params)
        return {"ca":ca,"nc":nc} 
    def 饮用地下水途径(self,params):
        ca=self.A19(params)
        nc=self.A20(params)
        return {"ca":ca,"nc":nc}  
class SoilExposeModelType2(SoilExposeModel):
    def 经口摄入土壤途径(self,params):
        ca=self.A21(params)
        nc=self.A22(params)
        return {"ca":ca,"nc":nc} 
    def 皮肤接触土壤途径(self,params):
        A5="239 * pow(H_a,0.417) * pow(BW_a,0.517) * SER_a" 
        SAE_a=self.A5(params)
        ca=self.A23(params,{"SAE_a":SAE_a})
        nc=self.A24(params,{"SAE_a":SAE_a})
        return {"ca":ca,"nc":nc}  
    def 吸入土壤颗粒物途径(self,params):
        ca=self.A25(params)
        nc=self.A26(params)
        return {"ca":ca,"nc":nc}  
    def 吸入室外空气中来自表层土壤的气态污染物途径(self,params):
        ca=self.A27(params)
        nc=self.A28(params)
        return {"ca":ca,"nc":nc}  
    def 吸入室外空气中来自下层土壤的气态污染物途径(self,params):
        ca=self.A29(params)
        nc=self.A30(params)
        return {"ca":ca,"nc":nc}  
    def 吸入室外空气中来自地下水的气态污染物途径(self,params):
        ca=self.A31(params)
        nc=self.A32(params)
        return {"ca":ca,"nc":nc}  
    def 吸入室内空气中来自下层土壤的气态污染物途径(self,params):
        ca=self.A33(params)
        nc=self.A34(params)
        return {"ca":ca,"nc":nc}  
    def 吸入室内空气中来自地下水的气态污染物途径(self,params):
        ca=self.A35(params)
        nc=self.A36(params)
        return {"ca":ca,"nc":nc} 
    def 饮用地下水途径(self,params):
        ca=self.A37(params)
        nc=self.A38(params)
        return {"ca":ca,"nc":nc}  